import lejos.nxt.LCD;
import lejos.nxt.LightSensor;
import lejos.nxt.SensorPort;


public class TestLightSensor {	
	public static void main(String [] args) throws InterruptedException{
		LightSensor lightSensor = new LightSensor(SensorPort.S1);
		
		LCD.drawString("Callibrate white", 0, 0);
		lightSensor.calibrateLow();		
		Thread.sleep(3000);
		LCD.drawString("Calibrate black", 0, 1);
		lightSensor.calibrateHigh();
		Thread.sleep(3000);		
		/*LCD.drawString("Calibrate color to follow", 0, 3);
		int toFollow = lightSensor.readValue();
		Thread.sleep(5000);*/
		LCD.clearDisplay();
		
		int value;
		while(true){
			LCD.clearDisplay();
			value = lightSensor.getLightValue();
			LCD.drawString("value: " + value, 0, 0);
			Thread.sleep(200);
			
		}
	}
}
